<h2>Anciens étudiants</h2>

Sélectionnez la promotion à consulter :
<?= form_dropdown('promo_year', $promotions, $selected_promo) ?>
<script type="text/javascript">
$(function() {
	$('select[name=promo_year]').change(function() {
		year = $('select[name=promo_year] option:selected').val();
		window.location = BASE_URL + 'candidats/former_students/' + year;
	});
	
});
</script>
<table class="dataTable">
	<thead>
		<tr>
			<th>Nom</th>
			<th>Prénom</th>
			<th>E-mail</th>
			<th>Créé le</th>
			<th>Année de promotion</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($users as $user) { ?>
			<tr id="user_<?= $user->id ?>">
				<td><?= $user->name ?></td>
				<td><?= $user->firstname ?></td>
				<td><?= $user->email ?></td>
				<td><?= time_to_str($user->created_at) ?></td>
				<td><?= $user->promo_year ?></td>
				<td class="actions">
					<?= details_link($user, 'user_details') ?>
					<?= edit_link($user, 'candidats/user_edit') ?>
					<?= delete_link($user, 'user_delete') ?>
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>

